package com.mpcm.web.client.admin;

import com.gwtplatform.mvp.client.ViewImpl;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.SimplePanel;

public class AdminLayoutView extends ViewImpl implements
		AdminLayoutPresenter.MyView {

	private final Widget widget;

	public interface Binder extends UiBinder<Widget, AdminLayoutView> {
	}
	
	@UiField SimplePanel containerLeft;
	@UiField SimplePanel containerRight;

	@Inject
	public AdminLayoutView(final Binder binder) {
		widget = binder.createAndBindUi(this);
	}

	
	
	@Override
	public void setInSlot(Object slot, Widget content) {
		if(slot == AdminLayoutPresenter.TYPE_RevealContentLeft) {
			if(content != null)
				containerLeft.add(content);
		} else if(slot == AdminLayoutPresenter.TYPE_RevealContentRight) {
			if(content != null)
				containerRight.add(content);
		} else
			super.setInSlot(slot, content);
	}



	@Override
	public Widget asWidget() {
		return widget;
	}
	
}
